package de.jmda.gen.java;

import javax.validation.constraints.NotNull;

import de.jmda.gen.CompoundGenerator;

/**
 * Generator for complete declaration of a method like <code>void method_name()
 * {}</code>.
 *
 * @author rwegner
 */
public interface DeclaredMethodGenerator
		extends CompoundGenerator, DeclaredElementGenerator
{
	@NotNull MethodHeaderGenerator getMethodHeaderGenerator();
	MethodBodyGenerator getMethodBodyGenerator();

	void setMethodHeaderGenerator(@NotNull MethodHeaderGenerator generator);
	void setMethodBodyGenerator(MethodBodyGenerator generator);

	/**
	 * @NotNull
	 * @return non null method body generator
	 */
	MethodBodyGenerator demandMethodBodyGenerator();

	MethodModifiersGenerator getModifiersGenerator();
	@NotNull TypeNameGenerator getTypeNameGenerator();
	@NotNull MethodNameGenerator getMethodNameGenerator();
	@NotNull MethodParametersGenerator getMethodParametersGenerator();
	ThrowsClauseGenerator getThrowsClauseGenerator();

	/**
	 * @NotNull 
	 * @return non null modifiers generator
	 */
	MethodModifiersGenerator demandModifiersGenerator();
	/**
	 * @NotNull
	 * @return non null throws clause generator
	 */
	ThrowsClauseGenerator demandThrowsClauseGenerator();

	void setModifiersGenerator(MethodModifiersGenerator generator);
	void setTypeNameGenerator(@NotNull TypeNameGenerator generator);
	void setMethodNameGenerator(@NotNull MethodNameGenerator generator);
	void setMethodParametersGenerator(@NotNull MethodParametersGenerator generator);
	void setThrowsClauseGenerator(ThrowsClauseGenerator generator);
	
	void add(ParameterGenerator generator);
	void setMethodBody(String methodBody);
}